function deepClone(target) {
  if (typeof target !== 'object' || target === null) {
    return target;
  }

  const newTarget = Array.isArray(target) ? [] : {};
  for (let key in target) {
    if(target.hasOwnProperty(key)) {
      newTarget[key] = deepClone(target[key]);
    }
  }
  return newTarget;
}


const a = {
  1: [{
    1: 'a'
  }]
}

const b = deepClone(a);
b[1]= 2
console.log(a);


